﻿@page "/sdk/objects/page/c/{PageName?}"

@model WebVella.Erp.Plugins.SDK.Pages.Page.CreateModel
@using WebVella.Erp.Web.Utils;
@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Create New Page";

}

<wv-page-header color="#dc3545" area-label="Pages" title="Create New Page" 
	icon-class="fa fa-plus" return-url="@Model.ReturnUrl">

<wv-page-header-actions>
	<wv-button type='Submit' form="CreateRecord" class='btn btn-green btn-sm'><span class='fa fa-save go-white'></span> Create Page</wv-button>
	<a href='@Html.Raw(Model.ReturnUrl)' class='btn btn-white btn-sm'>Cancel</a>
</wv-page-header-actions>

	</wv-page-header>

<wv-validation errors="@Model.Validation.ToErrorList()" message="@Model.Validation.Message"></wv-validation>

<wv-form id="CreateRecord" name="CreateRecord" validation-errors="Model.Validation.ToErrorList()" label-mode="Stacked" mode="Form">
	<wv-section class="mt-4" title="General" is-card="true">
		<wv-row>
			<wv-column span="4">
				<wv-field-text label-text="Name" value="@Model.Name" name="Name" required="true"></wv-field-text>
			</wv-column>
			<wv-column span="4">
				<wv-field-text label-text="Label" value="@Model.Label" name="Label" required="true"></wv-field-text>
			</wv-column>
			<wv-column span="4">
				<wv-field-text label-text="Sort Weight" value="@Model.Weight" name="Weight" required="true"></wv-field-text>
			</wv-column>
		</wv-row>
	</wv-section>
	<wv-section class="mt-4" title="Sitemap" is-card="true">
		@await Component.InvokeAsync("WvSdkPageSitemap", new { presetType = Model.Type, presetAppId = Model.AppId, presetEntityId = Model.PresetEntityId })
	</wv-section>
</wv-form>

